
Partial Class AdminLogin
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        chkRemMe.Visible = False
    End Sub

    Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
        Response.Redirect("Home.aspx")
    End Sub

    Protected Sub btnEnter_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnEnter.Click
        If txtAid.Text = "" Then
            lblErr.Text = "Admin ID field is blank!"
            lblErr.Visible = True
            Exit Sub
        ElseIf txtPswd.Text = "" Then
            lblErr.Text = "Password field is blank!"
            lblErr.Visible = True
            Exit Sub
        End If

        Dim a As New Globo
        a.executesql("select adminid, adminpass from admin where adminid = '" & txtAid.Text & "' and adminpass = '" & a.oCrypto.EncryptTripleDES(txtPswd.Text, Globo.sEncryptionKey).Replace("'", "''") & "'", False)


        If Not a.dr.Read Then
            lblErr.Text = "Wrong User name or Password"
            lblErr.Visible = True
            Exit Sub
        Else
            Session("admin") = a.dr(0)
            Session("type") = "admin"
        End If

        Session("prim") = Session("admin")
        Session("sec") = "admin"

        Response.Redirect("AProfile.aspx")
    End Sub

    Protected Sub AdminLogin_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
        'code for disable the cache
        '|||||||||||||||||||||||||||||||||||||||||||||||||||||||
        Response.Cache.SetCacheability(HttpCacheability.NoCache)
        '|||||||||||||||||||||||||||||||||||||||||||||||||||||||
    End Sub

    '_____________________________________________________________________________________________________________
    '*************************************************************************************************************
    Protected Sub lnkAboutUs_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkAboutUs.Click
        Response.Redirect("AboutUs.aspx")
    End Sub

    Protected Sub lnkTermCond_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkTermCond.Click
        Response.Redirect("TermsConditions.aspx")
    End Sub

    Protected Sub lnkContactUs_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkContactUs.Click
        Response.Redirect("ContactUs.aspx")
    End Sub

    Protected Sub lnkFAQs_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkFAQs.Click
        Response.Redirect("FAQs.aspx")
    End Sub

    Protected Sub lnkFeedback_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkFeedback.Click
        Response.Redirect("Feedback.aspx")
    End Sub
End Class